<?php
//ucenter接口封装类
class uc_user{
	public function __construct(){
		include_once(ROOT.'uc.inc.php');//包含配置文件
		include_once(ROOT.'uc_client/client.php');//包含uc客户端
	}
	public function system_login($username,$password){
		$username=iconv("UTF-8","GBK//IGNORE",$username);
		return uc_user_login($username, $password);
	}
	public function after_login($uid,$username){
		_setcookie('Example_auth', uc_authcode($uid."\t".$username, 'ENCODE'));
		echo uc_user_synlogin($uid);
	}
	public function system_register($username,$password,$email){
		$username=iconv("UTF-8","GBK//IGNORE",$username);
		return uc_user_register($username, $password, $email);
	}
	public function reg_action($username,$password,$email,$id){
		
	}
	public function system_edit($username,$old_password,$password,$email,$ignoreoldpw){
		$username=iconv("UTF-8","GBK//IGNORE",$username);
		return uc_user_edit($username, $old_password, $password, $email,$ignoreoldpw);
	}
	public function system_logout(){
		_setcookie('Example_auth', '', -86400);//清除uc 登陆信息
		echo uc_user_synlogout();
	}
	public function system_get_user($username,$isuid=0){
		$username=iconv("UTF-8","GBK//IGNORE",$username);
		return uc_get_user($username,$isuid);
	}
}